package com.mall.b2c.bean;

import com.mall.b2c.domain.intergral.IntergralLogDomain;
import com.mall.b2c.enums.IntergralLogType;
import org.apache.commons.lang3.time.DateFormatUtils;

/**
 * Created by chen on 16/12/20.
 */
public  class IntergralLogBean {

    private  String memberName;
    private Long memberId;
    private int nums;
    private int surplus;
    private String logText;
    private String logType;
    private String createDate;

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public int getNums() {
        return nums;
    }

    public void setNums(int nums) {
        this.nums = nums;
    }

    public int getSurplus() {
        return surplus;
    }

    public void setSurplus(int surplus) {
        this.surplus = surplus;
    }

    public String getLogText() {
        return logText;
    }

    public void setLogText(String logText) {
        this.logText = logText;
    }

    public String getLogType() {
        return logType;
    }

    public void setLogType(String logType) {
        this.logType = logType;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public IntergralLogBean(IntergralLogDomain domain){
        this.memberName = domain.getMember().getName();
        this.memberId = domain.getMember().getId();
        this.nums = domain.getNums();
        this.surplus = domain.getSurplus();
        this.logText = domain.getLogText();
        this.logType  = (domain.getLogtype()== IntergralLogType.reducenum?"减少":"增加");
        this.createDate = DateFormatUtils.format(domain.getCreateDate(), "yyyy-MM-dd");
    }
}